package week05.Tranning;

public class PresonServiceProxy implements PresonService{
  private PresonService presonService;

  public PresonServiceProxy(PresonService presonService) {
    this.presonService = presonService;
  }

  @Override
  public void save() {
    TransactionManager.begin();
    presonService.save();
    TransactionManager.commit();
  }

  @Override
  public void update() {
    TransactionManager.begin();
    presonService.update();
    TransactionManager.commit();
  }

  @Override
  public void delete() {
    TransactionManager.begin();
    presonService.delete();
    TransactionManager.commit();
  }

  @Override
  public void list() {

  }
}
